import request from '@/utils/request'

// 控制按钮配置列表
export function listControlConfig(query) {
  return request({
    url: '/ems/deviceDisplay/list',
    method: 'get',
    params: query
  })
}

// 串口列表
export function seriesIoOptions(query) {
  return request({
    url: '/device/seriesIo/seriesIoOptions',
    method: 'get',
    params: query
  })
}

// 串口详情
export function seriesDetail(id) {
  return request({
    url: '/device/seriesIo/'+id,
    method: 'get',
    params: {}
  })
}

// 配置按钮详情
export function configDetail(id) {
  return request({
    url: '/ems/deviceDisplay/'+id,
    method: 'get',
    params: {}
  })
}

// 新增配置按钮
export function creatControlConfig(data) {
  return request({
    url: '/ems/deviceDisplay',
    method: 'post',
    data: data
  })
}

// 编辑配置按钮
export function editControlConfig(data) {
  return request({
    url: '/ems/deviceDisplay',
    method: 'put',
    data: data
  })
}

// 删除配置按钮
export function delControlConfig(id) {
  return request({
    url: `/ems/deviceDisplay/${id}`,
    method: 'delete'
  })
}
